package com.wpx.Controller;

import com.wpx.Pojo.Paragraph;
import com.wpx.Service.ParagraphService;
import com.wpx.Util.MinioUtil;
import com.wpx.result.Result;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/pagagraph")
public class ParagraphController{
    //获取段落
    @Autowired
    public ParagraphService paragraphService;


    @GetMapping("getParagraphList")
    public Result getParagraphList (@RequestParam Integer articleId){
        List<Paragraph> lp= paragraphService.getParagraphList(articleId);
        return Result.ok(lp);
    }
    @PostMapping("/updateImages")
    public Result updateImages (@RequestBody  List<Paragraph>  lp){
        paragraphService.updateImages(lp);
        return Result.ok();
    }

}
